import request from '@/utils/request'

// 优惠卡开始---------------------------
export function getCardList() {
  return request({
    url: '/cards/card_list/',
    method: 'GET'

  })
}

export function getCards(params) {
  return request({
    url: '/cards/card/',
    method: 'GET',
    params
  })
}

export function addCard(data) {
  return request({
    url: '/cards/card/',
    method: 'POST',
    data
  })
}

export function updateCard(data) {
  return request({
    url: `/cards/card/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delCard(id) {
  return request({
    url: `/cards/card/${id}/`,
    method: 'DELETE',
  })
}

export function delCards(data) {
  return request({
    url: '/cards/card/batch_delete/',
    method: 'DELETE',
    data
  })
}

// 优惠卡结束--------------
// // 客户优惠卡开始

export function getCustomerCards(params) {
  return request({
    url: '/cards/customer_card/',
    method: 'GET',
    params
  })
}


export function addCustomerCard(data) {
  return request({
    url: '/cards/customer_card/',
    method: 'POST',
    data
  })
}


export function updateCustomerCard(data) {
  return request({
    url: `/cards/customer_card/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delCustomerCard(id) {
  return request({
    url: `/cards/customer_card/${id}/`,
    method: 'DELETE',
  })
}

export function delCustomerCards(data) {
  return request({
    url: '/cards/customer_card/batch_delete/',
    method: 'DELETE',
    data
  })
}

// 客户优惠卡结束
